]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fix key navigation on system menu sliders
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 22 Aug 2013 11:15:00 +0000 (13:15 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 22 Aug 2013 14:02:35 +0000 (16:02 +0200)
Rely key press events management if the menu item contains
a slider.

https://bugzilla.gnome.org/show_bug.cgi?id=706386

js/ui/slider.js
js/ui/status/brightness.js
js/ui/status/volume.js

index 6005d3d7253d9a6ce62ac3decf6daf59208fd706..e0e786759c733ab3c27102d9b9d53d3e24f2a5a7 100644 (file)
@@ -23,7 +23,7 @@ const Slider = new Lang.Class({
         this.actor.connect('repaint', Lang.bind(this, this._sliderRepaint));
         this.actor.connect('button-press-event', Lang.bind(this, this._startDragging));
         this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
-        this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPressEvent));
+        this.actor.connect('key-press-event', Lang.bind(this, this.onKeyPressEvent));
 
         this._releaseId = this._motionId = 0;
         this._dragging = false;
@@ -168,7 +168,7 @@ const Slider = new Lang.Class({
         return true;
     },
 
-    _onKeyPressEvent: function (actor, event) {
+    onKeyPressEvent: function (actor, event) {
         let key = event.get_key_symbol();
         if (key == Clutter.KEY_Right || key == Clutter.KEY_Left) {
             let delta = key == Clutter.KEY_Right ? 0.1 : -0.1;
index 5e586300ed67f751f6f445c290dae9f24dccea1d..800a7f28a9deefecaa1aed79cef736ee15d66b8a 100644 (file)
@@ -47,6 +47,10 @@ const Indicator = new Lang.Class({
         this._item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) {
             this._slider.startDragging(event);
         }));
+        this._item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) {
+            return this._slider.onKeyPressEvent(actor, event);
+        }));
+
     },
 
     _sliderChanged: function(slider, value) {
index a6f28828739e6b4ffdfb661d1c2b5c4a668da2af..b696b1ae4f33d18af02b17fbac7047bcc81dacfd 100644 (file)
@@ -44,6 +44,9 @@ const StreamSlider = new Lang.Class({
         this.item.actor.connect('button-press-event', Lang.bind(this, function(actor, event) {
             this._slider.startDragging(event);
         }));
+        this.item.actor.connect('key-press-event', Lang.bind(this, function(actor, event) {
+            return this._slider.onKeyPressEvent(actor, event);
+        }));
 
         this._stream = null;
     },